Skip to content

refactor(storePayment): 결제 데이터 없는 경우 204 반환하도록 변경#200

Merged
Jjiggu merged 1 commit into
developfrom
feature/#186-payment-crud
Jul 31, 2025
Merged

refactor(storePayment): 결제 데이터 없는 경우 204 반환하도록 변경#200
Jjiggu merged 1 commit into
developfrom
feature/#186-payment-crud

Conversation

@Jjiggu
Copy link
Copy Markdown
Contributor

@Jjiggu Jjiggu commented Jul 31, 2025

작업 요약

결제 데이터 없는 경우 204 반환하도록 변경

Issue Link

#186

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 버그 수정
    • 매장 결제 정보 조회 시, 해당 정보가 없을 경우 HTTP 204 NO CONTENT 상태로 응답하도록 개선되었습니다.
    • 매장 결제 정보가 존재하지 않을 때 더 이상 예외가 발생하지 않고, 빈 결과로 처리됩니다.

@Jjiggu Jjiggu self-assigned this Jul 31, 2025
@Jjiggu Jjiggu added the refactor 리팩토링 label Jul 31, 2025
@Jjiggu Jjiggu merged commit baadb33 into develop Jul 31, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 31, 2025

Warning

Rate limit exceeded

@Jjiggu has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 510efb5 and 98d3307.

📒 Files selected for processing (3)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/controller/StorePaymentController.java (2 hunks)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentService.java (1 hunks)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentServiceImpl.java (2 hunks)

Walkthrough

getStorePaymentByStoreId 메서드가 서비스, 구현체, 컨트롤러 계층에서 Optional<StorePaymentReadDto>를 반환하도록 일관성 있게 변경되었습니다. 기존에는 엔티티가 없을 때 예외를 던졌으나, 이제는 빈 Optional을 반환하고, 컨트롤러에서 204 NO CONTENT 상태로 응답합니다.

Changes

Cohort / File(s) Change Summary
Service Interface 및 구현체 반환 타입 변경
.../service/StorePaymentService.java, .../service/StorePaymentServiceImpl.java
getStorePaymentByStoreId의 반환 타입이 StorePaymentReadDto에서 Optional<StorePaymentReadDto>로 변경되었습니다. 구현체에서는 엔티티가 없을 때 예외 대신 빈 Optional을 반환합니다.
컨트롤러 응답 처리 개선
.../controller/StorePaymentController.java
서비스 계층의 반환값을 Optional로 받아, 값이 있을 때는 200 OK, 없을 때는 204 NO CONTENT로 응답하도록 분기 처리 로직이 추가되었습니다.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller
    participant Service
    participant Repository

    Client->>Controller: GET /store-payment/{storeId}
    Controller->>Service: getStorePaymentByStoreId(storeId)
    Service->>Repository: findByStoreId(storeId)
    alt StorePayment exists
        Repository-->>Service: Optional.of(StorePayment)
        Service-->>Controller: Optional.of(StorePaymentReadDto)
        Controller-->>Client: 200 OK + StorePaymentReadDto
    else StorePayment not found
        Repository-->>Service: Optional.empty
        Service-->>Controller: Optional.empty
        Controller-->>Client: 204 NO CONTENT
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#186-payment-crud

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant